<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
    <link rel="stylesheet" type="text/css" href="/renren/Public/Home/css/bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="/renren/Public/Home/css/admin.css" />
    <script type='text/javascript' src='/renren/Public/Home/js/jquery.min.js'></script>
    <script type='text/javascript' src='/renren/Public/Home/js/layer/layer.js'></script>
    <script type='text/javascript' src='/renren/Public/Home/js/common.js'></script>
    <title>后台管理</title>
    <style>
        .pop-imgshow{position:fixed;top:0;left:0;right:0;bottom:0;background: rgba(0,0,0,0.7);text-align: center;}
        .pop-imgshow span{display:inline-block;height:100%;vertical-align: middle;}
        .pop-imgshow img{max-width:80%;max-height:80%;vertical-align: middle;}
    </style>
</head>
<body>
<div class="main-container clearfix"><div class="main-content"><div class="inner"><div class="mall-manage">
    <div class="comm-list" style="min-height:600px">
        <div class="comm-top">
            <div class="title-left">
                角色列表
            </div>
            <div class="title-right" style="top:8px;">
                <form method="get" action="<?php echo U('index');?>">
                    <input name="keywords" class="textarea search_inp" placeholder="请输入用户名" type="text" value="<?php echo I('get.keywords');?>"/>
                    <input value="搜索" class="btn btn-success search_btn" type="submit" />
                    <input value="添加角色" class="btn btn-success search_btn" type="button" onclick="location.href='<?php echo U('add');?>'" />
                </form>
            </div>
        </div>
        <div class="list-table">
            <div class="wrapper">
                <table class="stable">
                    <thead>
                    <tr>
                        <th>角色名</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php if(is_array($list)): foreach($list as $key=>$v): ?><tr>
                            <td><?php echo ($v["title"]); ?></td>
                            <td><?php echo ($v["status"]); ?></td>
                            <td><div class="btn-operate">
                                <a href="<?php echo U('edit',array('id'=>$v['id']));?>" title="修改"><i class="glyphicon glyphicon-edit"></i></a>
                                <a href="javascript:void(0);" onclick="delRow('<?php echo ($v["id"]); ?>',this)" title="删除" id="delBtn<?php echo ($v["id"]); ?>"><i class="glyphicon glyphicon-trash"></i></a>
                            </div></td>
                        </tr><?php endforeach; endif; ?>
                    </tbody>
                </table>
            </div>
        </div>
        <div class="page-list"><?php echo ($page); ?></div>
    </div>
</div></div></div></div>
<script type="text/javascript">

    function delRow(id,obj){
        if(confirm('确定要删除吗？')){
            $.get("<?php echo U('del');?>",{id:id},function(res){
                if(res.status == 1){
                    note_info(res.info,obj);
                    setTimeout('location.reload()',1200);
                }else{
                    note_info(res.info,obj,'warn');
                }
            });
        }
    }
</script>
</body>
</html>